//
//  delimitedfilereader.h
//  IO
//
//  Created by Mark Lord on 2013-06-16.
//  Copyright (c) 2013 Mark Lord. All rights reserved.
//

#ifndef __IO__delimitedfilereader__
#define __IO__delimitedfilereader__

#include "datareader.h"
#include <boost/shared_ptr.hpp>
#include <iostream>
#include <fstream>
#include <vector>

typedef std::vector<std::string> Record;

class DelimitedFileReader: public Datareader
{
public:
    //Constructor/destructor
    DelimitedFileReader(std::string _filePath, std::string delim);
    ~DelimitedFileReader();
    
    //Gets
    Record &get();
    boost::shared_ptr<std::vector<Record>> getAll();
    
    //Methods
    virtual bool read();
    virtual void readAll();
    
private:
    //Members
    boost::shared_ptr<std::vector<Record>> m_pData;
    std::ifstream m_inFile;
    std::string m_delim;
};

#endif /* defined(__IO__delimitedfilereader__) */
